package exe2;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Delete {

	public static void main(String[] args) {
		List<Integer> list = new ArrayList<Integer>();
		for (int i = 0; i < 10; i++) {
			list.add(i + 1);
		}
		Iterator<Integer> it = list.iterator();
		while (it.hasNext()) {
			System.out.print(it.next() + " ");
		}
		System.out.println();
		delete(list, 4);
		Iterator<Integer> it2 = list.iterator();
		while (it2.hasNext()) {
			System.out.print(it2.next() + " ");
		}
	}

	public static List<Integer> delete(List<Integer> list, int n) {
		list.remove(n - 1);
		return list;
	}
	
}
